<% include ../public/page_header.html %>
    <link href="/public/wysiwyg/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="/public/wysiwyg/js/froala_editor.pkgd.min.js"></script>
    <script type="text/javascript" src="/public/wysiwyg/js/languages/zh_cn.js"></script>

    <div class="panel panel-default">
        <div class="panel-heading">
            增加菜品
        </div>
        <div class="panel-body">
            <div class="table-responsive input-form">
                <form action="/<%=adminPath%>/product/doAdd?_csrf=<%=csrf%>" method="post"
                    enctype="multipart/form-data">
                    <ul>

                        <li>
                            <label class="col-sm-2">菜品分类:</label>
                            <div class="col-sm-10">
                                <select name="cid" id="cid">
                                    <%for(var i=0;i<cateList.length;i++){%>
                                        <option value="<%=cateList[i].id%>"><%=cateList[i].title%></option>
                                    <%}%>
                                </select>
                            </div>
                        </li>

                        <li>
                            <label class="col-sm-2">菜品名称:</label>
                            <div class="col-sm-10">
                                <input type="text" name="title" />
                            </div>
                        </li>
                        
                        <li>
                            <label class="col-sm-2">菜品图片:</label>
                            <div class="col-sm-10">
                                <input type="file" name="imgUrl">
                            </div>
                        </li>

                        <li> 
                            
                            <label class="col-sm-2">菜品价格:</label>
                            <div class="col-sm-10">
                                <input type="text" name="price" value="10" />  <i>单位：元</i>
                            </div>
                        </li>

                        <li> 
                            <label class="col-sm-2">菜品排序:</label> 
                            <div class="col-sm-10">
                                <input type="text" name="sort" value="100" />
                            </div>
                        </li>
                        <li> 
                            <label class="col-sm-2"> 菜品状态:</label> 
                            <div class="col-sm-10">                                   
                                <input type="radio" name="status" checked value="1" id="a"/> <label for="a">显示</label>    &nbsp;&nbsp;                              
                                <input type="radio" name="status"  value="0" id="b"/><label for="b">隐藏</label>
                            </div>
                        </li>
                        <li> 
                            <label class="col-sm-2">加入推荐:</label> 
                            <div class="col-sm-10">                                               
                                <input type="checkbox" value="1" name="isBest" checked id="is_best"> <label for="is_best">精品</label>  &nbsp;&nbsp;
                                <input type="checkbox" value="1" name="isHot" checked id="is_hot"> <label for="is_hot">热销</label> 
                            </div>
                        </li>
                        <li>
                            <label class="col-sm-2">菜品详情:</label>
                            <div class="col-sm-10">
                                <textarea name="content" id="content" cols="30" rows="10"></textarea>
                            </div>
                        </li>
                        <li>
                            <br />
                            <button type="submit" class="btn btn-primary">提交</button>
                        </li>
                    </ul>


                </form>
            </div>
        </div>


    </div>
    <script>
        new FroalaEditor('#content', {
            height: 300,
            language: "zh_cn",
            attribution: false,  //去掉版权
            // imageUploadURL: '/<%=adminPath%>/product/doUpload?_csrf=<%=csrf%>',
            imageUploadURL: '/<%=adminPath%>/product/doUpload',           
        });
    </script>

    </body>

    </html>